// {一、项目初步：1.0 配置路由}
// [1.0.2]路由搭建
// （现状分析：）目前只能做到的是通过逐一引入组件的形式，手动生成路由
// （可能的优化：）通过某种函数，将路由动态引入生成，从而达到项目模块化的效果
// （操作步骤：）a.1引入组件依赖，a.2添加 Router
import React, { Component } from 'react'
import { HashRouter as Router, Route } from "react-router-dom"
// 首屏路由托管引入
import Tabbar from "./components/tabbar/Tabbar"
// 首屏显示：5大基础组件
import Index from "./components/index/Index"
import Category from "./components/category/Category"
import Cart from "./components/cart/Cart"
import My from "./components/my/My"
// 添加功能一：顶部搜索框
import SearchCenter from "./components/searchCenter/SearchCenter"
// 添加功能二：商品列表
import GoodsList from "./components/goodsList/GoodsList"
// 添加功能三：商品详情
import GoodsDetail from "./components/goodsDetail/GoodsDetail"
// 添加功能四：支付
import Pay from "./components/pay/Pay"
// 登录
import Login from './components/signIn/SignIn'
// 注册
import Sign from './components/signUp/SignUp'
// 收货地址
import Address from './components/address/Address'
// 收藏页面
import Collections from './components/collections/Collections'
import Mine from './components/mine/Mine'
export default class RouterConfig extends Component {
    render() {
        return (
            <Router>
                <Route path="/" exact render={(props) => <Tabbar><Index {...props}></Index></Tabbar>}></Route>
                <Route path="/category" exact render={(props) => <Tabbar><Category {...props}></Category></Tabbar>}></Route>
                <Route path="/cart" exact render={(props) => <Tabbar><Cart {...props}></Cart></Tabbar>}></Route>
                <Route path="/my" exact render={(props) => <Tabbar><My {...props}></My></Tabbar>}></Route>
                
                <Route path="/searchCenter" exact render={(props) => <SearchCenter {...props}></SearchCenter>}></Route>
                <Route path="/GoodsList/:cid" exact render={(props) => <GoodsList {...props}></GoodsList>}></Route>
                <Route path="/GoodsDetail/:cid/:id" exact render={(props) => <GoodsDetail {...props}></GoodsDetail>}></Route>
                <Route path="/pay" exact render={(props) => <Pay {...props}></Pay>}></Route>
                <Route path="/Login" exact render={(props) => <Login {...props}></Login>}></Route>
                <Route path="/Sign" exact render={(props) => <Sign {...props}></Sign>}></Route>
                <Route path="/Address" exact render={(props) => <Address {...props}></Address>}></Route>
                <Route path="/Collections" exact render={(props) => <Collections {...props}></Collections>}></Route>
                <Route path="/mine" exact render={(props) => <Mine {...props}></Mine>}></Route>
                
            </Router>
        )
    }
}
